﻿@using System.Collections.Generic
@model List<HuntingFishGame.ManageDomain.Model.User.WxCodeModel>
@{
    Layout = null;
}

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta name="viewport" content="initial-scale=1, maximum=1,minimum=1, user-scalable=no" />
    <title></title>
</head>
<body>
    <form id="form1">
        <div style=" width:100%; height:100%;position:absolute;top:0px;margin:0 auto;" id="div1">
            <img src="/image/cjd.png" style="width:100%; height:100%;  margin-left:0px" alt="" />
            <center>
                <div style="margin-top: -200px;">
                    <a href="javascript:void(0);" onclick="ImageButton1_Click">
                        <input type="image" src="/image/btncj.png" style="width: 150px; height: 150px;" />
                    </a>
                </div>
            </center>
        </div>
        <div id="div2">
            <div style="margin-top:0px">
                <center>
                    <h1 style="color:Green; font-size:40px">抽奖成功</h1>
                    <!--<image src="/image/OK.png" width="250px" hight="210px"></image> --><br />
                    <span style="color:Red; font-size:20px">恭喜你成功抽取了<%=mony%>鱼币！</span><br /><br />
                </center>
            </div>
        </div>
        <div id="div3">
            <div style="margin-top:0px">
                <center>
                    <h1 style="color:Green;font-size:40px ">抽奖失败</h1>
                    <!--<image src="/image/next.png" width="250px" hight="210px"></image>--><br /><br />
                    <!--<span style="color:Red; font-size:20px">请检查你的微信号是否正确</span><br /><br />-->
                </center>
            </div>
        </div>
        <div id="div4" style="margin-top:5px;">
            <center>
                <image src="/image/logo.png" style="Width:30%"></image> <br /><br />
                <span style="">需要验证您的游戏帐号</span><br/><br/>
                <label id="lblUserID" for="lblUserID">游戏账号：</label>
                <input type="text" id="txtUserID" style="width: 200px; height: 30px;" />
                <br/><br/>
                <label id="lblPassword" for="lblPassword">游戏密码：</label>
                <input type="password" id="txtPassword" style="width: 200px; height: 30px"/>
                <br /><br />
                <a href="javascript:void(0);" onclick="imgBtuLogin_Click">
                    <input type="image" src="/image/loginOk.png" style="width: 130px;" />
                </a>
                <br /><br />
                <span style="color:Red">
                    温馨提示：请确认此链接来自于猎鱼岛游戏官方公众平台，以免帐号泄露<br />
                </span>
            </center>
        </div>
        <div id="div5" style="margin-top:5px; display:none">
            <center>
                <input type="image" src="/image/logo.png" style="Width: 30%" />
                <br/><br/>
                <span style="color: Red"> 您的微信绑定了多个账号，请选择需要加鱼币的账号</span><br/>
                <div class="classlist">
                    <div class="autoScroll">
                        <select id="radUSer">
                            <option value="">请选择</option>
                            @if (Model != null && Model.Any())
                            {
                                foreach (var item in Model)
                                {
                                    <option value="@item.UserId">@item.NickName</option>
                                }
                            }
                        </select>
                        <br/>

                    </div>

                </div>
                <a href="javascript:void(0);" onclick="imgBtuChooseGame">
                    <input type="image" src="/image/loginOk.png" style="width: 130px;" />
                </a>
                <br/>
                <span> 同一个微信号，每天只能领取一次哦</span>
            </center>
        </div>
    </form>
</body>
</html>
<script type="text/javascript">
    //抽奖
    function ImageButton1_Click() {
        $.ajax({
            url: "/UserCheckIn/imgBtuCJ_Click?@Html.Raw(Request.QueryString.ToString())",
            data: {
                'userId': $("#txtUserID").val().toString().trim(),
                'password': $("#txtPassword").val().toString().trim()
            },
            type: "POST",
            success: function(data) {
                //提交成功直接转入地址
                if (data.code === 1) {
                    DivVisible(parseInt(data.data.state));
                    @*if (data.ReturnUrl === "" || data.ReturnUrl == null) {
                        window.location.href = "@SiteUrls.Instance().Success()";
                    } else {
                        window.location.href = decodeURIComponent(data.ReturnUrl);
                }*@
                } else {
                    alert(data.msg);
    }
    },
    error: function() {
        alert("服务器开小差了，请重试");
    }
    });
    }
    //注册检测
    function imgBtuLogin_Click() {
        //var ret = checkForm();
        //if (!ret) {
        //    return;
        //}
        $.ajax({
            url: "/UserCheckIn/imgBtuLogin_Click?@Html.Raw(Request.QueryString.ToString())",
            data: {
                'userId': $("#txtUserID").val().toString().trim(),
                'password': $("#txtPassword").val().toString().trim()
            },
            type: "POST",
            success: function(data) {
                //提交成功直接转入地址
                if (data.code === 1) {
                    DivVisible(parseInt(data.data.state));
                    @*if (data.ReturnUrl === "" || data.ReturnUrl == null) {
                        window.location.href = "@SiteUrls.Instance().Success()";
                    } else {
                        window.location.href = decodeURIComponent(data.ReturnUrl);
                    }*@
                } else {
                    alert(data.msg);
                }
            },
            error: function() {
                alert("服务器开小差了，请重试");
            }
        });
    }
    function imgBtuChooseGame() {
        $.ajax({
            url: "/UserCheckIn/imgBtuChooseGame?@Html.Raw(Request.QueryString.ToString())",
            data: {
                'uName': $("#radUSer").val().toString().trim()
            },
            type: "POST",
            success: function(data) {
                //提交成功直接转入地址
                if (data.code === 1) {
                    DivVisible(parseInt(data.data.state));
                    @*if (data.ReturnUrl === "" || data.ReturnUrl == null) {
                        window.location.href = "@SiteUrls.Instance().Success()";
                    } else {
                        window.location.href = decodeURIComponent(data.ReturnUrl);
                }*@
                } else {
                    alert(data.msg);
    }
    },
    error: function() {
        alert("服务器开小差了，请重试");
    }
    });
    }
    this.DivVisible(1);//开始页面
    //控制div显示
    function DivVisible(no) {
        if (no == 1) //开始页面
        {
            this.div1.Visible = true;
            this.div2.Visible = false;
            this.div3.Visible = false;
            this.div4.Visible = false;
            this.div5.Visible = false;
        } else if (no == 2) //领取成功
        {
            this.div1.Visible = false;
            this.div2.Visible = true;
            this.div3.Visible = false;
            this.div4.Visible = false;
            this.div5.Visible = false;
        } else if (no == 3) //领取失败
        {
            this.div1.Visible = false;
            this.div2.Visible = false;
            this.div3.Visible = true;
            this.div4.Visible = false;
            this.div5.Visible = false;
        } else if (no == 4) //没有绑定微信
        {
            this.div1.Visible = false;
            this.div2.Visible = false;
            this.div3.Visible = false;
            this.div4.Visible = true;
            this.div5.Visible = false;
        } else if (no == 5) //微信绑定多个用户
        {
            this.div1.Visible = false;
            this.div2.Visible = false;
            this.div3.Visible = false;
            this.div4.Visible = false;
            this.div5.Visible = true;
        }
    }
</script>
